<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>门户测试自研平台</title>
    <link rel="stylesheet" th:href="@{/lib/layui-v2.7.3/layui/css/layui.css}" >
    <script th:src="@{/lib/layui-v2.7.3/layui/layui.js}" charset="utf-8"></script>
</head>
<body>
<table class="layui-hide" id="test" lay-filter="test">


</table>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script>
    layui.use('table', function(){
        var table = layui.table;
        table.render({
             elem: '#test'
            ,url:'/admin/stulistJson'
            ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
            ,title: '学生数据表'
            ,cols: [
                [
                    {type: 'checkbox', fixed: 'left'}
                    ,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true}
                    ,{field:'name', title:'学生名字', width:120}
                    ,{field:'address', title:'微信备注', width:120}
                    ,{field:'phone', title:'微信id', width:120}
                    ,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:150}
                ]
            ]
            ,page: true
            ,limit:10
            ,limits:[7,8,9,10]
        });
    })

</script>
</body>
</html>